12/12/2022

R Markdown

Summary of this presentation :

This presentation aims to present a built and deployed Shiny application on Rstudio’s servers.

Using a reproducible pitch presentation about the application wil be describe in next pages

Keys section of this presentation are :

  1. Used data and purpose analysis

  2. Quick presentation of models and parameters

  3. Indicators computing and Data Representations

Final App can bes acces here [https://github.com/SixChemins/R_Data_Product/tree/main/Shiny_App]

Summary : Used data and purpose analysis

From Brownian asset prices, a basic equal weighted portfolio was built and associated indicators are computed

Asset price are randomly generate using geometric Brownian motion that is a continuous-time stochastic process in which the logarithm of the randomly varying quantity follows a Brownian motion (also called a Wiener process.

For more details, please refer to follow links: 1.[https://en.wikipedia.org/wiki/Geometric_Brownian_motion] 2.[https://www.quora.com/What-is-Brownian-motion-and-how-is-it-applied-to-financial-markets]

Using generated data, an equal-weighted portfolio is built and indicators of return and variance are derived on said portfolio

Quick presentation of models and parameters

Geometric Brownian motion vector simulate in datset used required parameters (some of them are set as tuning parameter for user)

  • So : Start value of asset price (set at 100)
  • mu : Drift, mean of Brownian motion
  • Sigma : Volatility of Brownian motion
  • N_Eq : Number of Asset (Used in portfolio)
  • t : Number of points for observed price (set)

Portfolio construction is done by using equal weight which means that for N asset the individual percentage is (1/N). Note that the number of asset is also a parameter that can be tuned by user.

Indicators computing and Data Representations (1/2)

## Compute Portfolio Return
  ptf_returns <- sum(df_eq_return * pf_eq_w)
  print(paste0("Portfolio Return is : ", 
               round(100*ptf_returns, 2), "%"))
## [1] "Portfolio Return is : -18.34%"
## Compute Portfolio Volatility
  df_eq_cov <- cov(df_eq_return)
  ptf_volatility <- sqrt(t(pf_eq_w) %*% df_eq_cov %*% pf_eq_w)
  print(paste0("Portfolio Volatility is : ", 
               round(100*ptf_volatility, 2), "%"))
## [1] "Portfolio Volatility is : 0.32%"

Indicators computing and Data Representations (2/2)